home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / python2.6 / dist-packages / AppInstall / DialogProprietary.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-10-12  |  3.1 KB  |  69 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. from SimpleGladeApp import SimpleGladeApp
  5. import gtk
  6. import gobject
  7. import os
  8. from gettext import gettext as _
  9. import gettext
  10. from BrowserView import GtkHtml2BrowserView as BrowserView
  11.  
  12. class DialogProprietary(SimpleGladeApp):
  13.     
  14.     def __init__(self, datadir, parent, item):
  15.         SimpleGladeApp.__init__(self, path = datadir + '/gnome-app-install.glade', root = 'dialog_proprietary', domain = 'gnome-app-install')
  16.         if item.isv:
  17.             vendor = item.isv
  18.         else:
  19.             vendor = item.channel
  20.         header = _('Enable the installation of software from %s?') % vendor
  21.         body = _('%s is provided by a third party vendor.') % item.name
  22.         internet = _('You need a working internet connection to continue.')
  23.         msg = '<b><big>%s</big></b>\n\n%s\n\n%s' % (header, body, internet)
  24.         self.dialog_proprietary.set_transient_for(parent)
  25.         self.dialog_proprietary.realize()
  26.         self.dialog_proprietary.window.set_functions(gtk.gdk.FUNC_MOVE)
  27.         self.label_proprietary.set_markup(msg)
  28.         self.item = item
  29.         self.button_add_channel.set_label(_('_Enable'))
  30.  
  31.     
  32.     def run(self):
  33.         if self.item.licenseUri:
  34.             msg = self.label_proprietary.get_label()
  35.             msg += '\n\n'
  36.             msg += _("The application comes with the following license terms and conditions. Click on the 'Enable' button to accept them:")
  37.             self.label_proprietary.set_markup(msg)
  38.             self.tooltips = gtk.Tooltips()
  39.             self.tooltips.set_tip(self.button_add_channel, _('Accept the license terms and install the software'))
  40.             self.browser.show()
  41.             self.browser.loadUri(self.item.licenseUri)
  42.         else:
  43.             self.browser.hide()
  44.         self.button_add_channel.grab_default()
  45.         return self.dialog_proprietary.run()
  46.  
  47.     
  48.     def hide(self):
  49.         self.dialog_proprietary.hide()
  50.  
  51.     
  52.     def create_proprietary_browser_view(self, s1, s2, i1, i2):
  53.         self.browser = BrowserView()
  54.         return self.browser
  55.  
  56.  
  57. if __name__ == '__main__':
  58.     import sys
  59.     
  60.     class Item(object):
  61.         pass
  62.  
  63.     item = Item()
  64.     item.licenseUri = sys.argv[1]
  65.     item.channel = sys.argv[1]
  66.     dia = DialogProprietary('../data/', None, item)
  67.     dia.run()
  68.  
  69.